// 顶部导航组件
import React from 'react'
// 引入react-route-dom@6 编程式导航跳转所需要的hook钩子函数useNavigate
import { useNavigate } from 'react-router-dom'
import { NavBar, Space, Toast } from 'antd-mobile'
type Props = {
    children: string
}

export default function NavBarCom1(props: Props) {
    const right = (
        <div style={{ fontSize: 24 }}>
            <Space style={{ '--gap': '16px' }}>
            </Space>
        </div>
    )
    const navigate = useNavigate()
    //返回上一页：navigate(-1)
    const back = () => { navigate(-1) }
    return (
        <div>
            <NavBar  back='返回' right={right} onBack={back}>
                {props.children}
            </NavBar>
        </div>
    )
}